home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_class_sharpboulder.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  65 lines

  1. # Jones 3D Cog Script
  2. #
  3. # class_SharpBoulder.cog
  4. #
  5. # [MDR]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message     touched
  14.  
  15. # ************************** TEMPLATE *******************
  16. template    tpl_rocksa=rocksa
  17. template    tpl_rocksb=rocksb
  18.  
  19. # ************************** MISC LOCAL VARS *******************
  20. thing        t_boulder    local
  21. thing        t_player    local
  22. vector        vec_look    local
  23. vector        vec_player    local
  24. int            n_damage    local
  25. int            semaphore=0    local
  26. end
  27.  
  28. # ===================================================================
  29.  
  30. code
  31.  
  32. # ...................................................................
  33. touched:
  34.  
  35.     if ( GetSourceRef() == GetLocalPlayerThing() && !semaphore)
  36.     {
  37.         t_boulder    = GetSenderRef();
  38.         t_player    = GetLocalPlayerThing();
  39.  
  40. //        vec_look    = GetThingLVec( t_boulder );
  41. //        vec_player    = VectorSub( GetThingPos(t_boulder), GetThingPos(t_player) );
  42. //        vec_player    = VectorNorm( vec_player );
  43.  
  44.         if ( GetThingTemplate(t_boulder) == tpl_rocksa )
  45.         {
  46.             n_damage = 10000; # 10000 is 10 percent of raft total
  47.         }
  48.         else
  49.         {
  50.             n_damage = 10000;
  51.         }
  52. //        if ( VectorDot(vec_look, vec_player) <= 0.5 )
  53.         {
  54.             semaphore=1;
  55.             DamageThing(t_player, n_damage, 0x00400000, t_boulder);
  56.             Sleep(3.0); // so we don't damage him every frame
  57.             semaphore=0;
  58.         }
  59.     }
  60.  
  61.     return;
  62.  
  63. end
  64.  
  65.